<?php

use think\facade\Request;
use think\facade\Route;

Route::group('api', function () {
    
    Route::get('test', function() {
        $comm = \app\api\model\Commodity::with(['products'=> function($query){
            $query->field('id,color,size,commodity_id')->order('id', 'desc')->group('color,size,id');
        }])->field('id,name')->order('id', 'desc')->all();
        // $commodity->products;
        return $comm->map(function($item) {
             $item->products = $item->products->map(function($p){return $p->getData();});
            //  retrun $item;
           dump($item->products);
           echo '-------------------------------';
		   dump($item->products->column('color'));
		   echo 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC';
		    dump($item->products->column('size'));
           echo 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS';
        }, $comm);
    });
    Route::post('register', 'login/register');
    Route::post('login', 'login/login');
    Route::post('uploadImage/:dir', 'upload/upload');
    Route::get('uploadImage/:dir', 'upload/index');
    Route::get('index', 'Index/index');
    Route::get('SaleSummary', 'Index/SaleSummary');
    Route::get('customerAnal', 'Index/customerAnal');
    Route::get('goodsAnal', 'Index/goodsAnal');
    Route::get('clerkAnal', 'Index/clerkAnal');
    Route::get('goodsProfit', 'Index/goodsProfit');
    Route::get('storeProfit', 'Index/storeProfit');
    /*Route::post('getSpec', 'purchase/getSpec');
    Route::get('getCacheSpec', 'purchase/getCacheSpec');
    Route::post('getEditProduct', 'purchase/getEditProduct');
    Route::get('getCacheColor/:id', 'purchase/getCacheColor');
    Route::get('getCacheSize/:id', 'purchase/getCacheSize');*/
    Route::post('getGoodsStock', 'purchase/getGoodsStock');
    Route::get('commodityStock', 'CommodityStock/index');
    Route::get('commodityStock/:id', 'CommodityStock/show');
    // 商品相关
    Route::get('commodity', 'commodity/index');
    Route::get('getProduct/:id', 'commodity/indexProduct');
    Route::get('getProducts/:id', 'commodity/getProduct');
    Route::get('commodity/:id', 'commodity/show');
    Route::post('commodity', 'commodity/store');
    Route::put('commodity/:id', 'commodity/update');
    Route::delete('commodity/:id', 'commodity/delete');
    Route::get('getGoods', 'commodity/getGoods');


    Route::get('product', 'product/index');
    Route::get('product/:id', 'product/show');
    Route::post('product', 'product/store');
    Route::put('product/:id', 'product/update');
    Route::delete('product/:id', 'product/delete');
    Route::get('getAllProduct/:id', 'product/getAllProduct');

    Route::get('goodsList', 'goods/index');
    Route::post('goods', 'goods/add');
    Route::get('goods/:id', 'goods/show')->model('\app\api\model\Goods', false);
    Route::put('goods/:id', 'goods/edit')->model('\app\api\model\Goods', false);
    Route::delete('goods/:id', 'goods/del')->model('\app\api\model\Goods', false);
    //采购
    Route::get('purchaseList', 'purchase/PurchaseList');
    Route::post('purchaseAdd', 'purchase/PurchaseAdd');
    Route::get('purchaseDetail/:id', 'purchase/PurchaseDetail')->model('\app\api\model\PurchaseModel', false);
    Route::post('PurchaseDraft/:id', 'purchase/PurchaseDraft')->model('\app\api\model\PurchaseModel', false);
    Route::post('getPutPurchase/:id', 'purchase/getPutPurchase')->model('\app\api\model\PurchaseModel', false);
    Route::delete('purchaseDel/:id', 'purchase/PurchaseDel')->model('\app\api\model\PurchaseModel', false);
    Route::get('purchaseRevoke/:id', 'purchase/PurchaseRevoke')->model('\app\api\model\PurchaseModel', false);
    Route::post('purchaseDepot/:id', 'purchase/Purchasedepot')->model('\app\api\model\PurchaseModel', false);
    Route::get('purchaseAllDepot/:id', 'purchase/alldepot')->model('\app\api\model\PurchaseModel', false);
    Route::get('purchaseReturnList', 'purchase/returnList');
    Route::post('purchaseReturnAdd', 'purchase/returnAdd');
    Route::post('purchaseReturn/:id', 'purchase/purchaseReturn');
    Route::post('purchaseReturnDraft/:id', 'purchase/purchaseReturnDraft')->model('\app\api\model\PurchaseModel', false);
    Route::get('purchaseReturnDetail/:id', 'purchase/returnDetail')->model('\app\api\model\PurchaseModel', false);
    //Route::post('purchaseReturnDepot/:id', 'purchase/returnDepot')->model('\app\api\model\PurchaseModel', false);
    Route::get('purchaseReturnRevoke/:id', 'purchase/returnRevoke')->model('\app\api\model\PurchaseModel', false);
    Route::delete('purchaseReturnDel/:id', 'purchase/returnDel')->model('\app\api\model\PurchaseModel', false);
    Route::get('getTodayNum', 'purchase/getTodayNum');
    // 智能补货
    Route::get('smartReplenish', 'SmartReplenish/index');
    Route::post('smartReplenish', 'SmartReplenish/store');
    // 客户相关
    Route::get('userList', 'user/index');
    Route::post('user', 'user/add');
    Route::get('user/:id', 'user/show')->model('\app\api\model\User', false);
    Route::put('user/:id', 'user/edit')->model('\app\api\model\User', false);
    Route::delete('user/:id', 'user/del')->model('\app\api\model\User', false);
    Route::get('getAllMaker', 'user/getAllMaker');
    Route::get('getAllSales', 'user/getAllSales');
    Route::get('getAllCustomer/:id', 'user/getAllCustomer');
    // 客户分类
    Route::get('customerCategoryList', 'customerCategory/index');
    Route::get('customerCategoryListUse', 'customerCategory/getCanUseList');
    Route::post('customerCategory', 'customerCategory/add');
    Route::get('customerCategory/:id', 'customerCategory/show')->model('\app\api\model\CustomerCategory', false);
    Route::put('customerCategory/:id', 'customerCategory/edit')->model('\app\api\model\CustomerCategory', false);
    Route::delete('customerCategory/:id', 'customerCategory/del')->model('\app\api\model\CustomerCategory', false);
    //销售
    Route::get('saleList', 'sale/SaleList');
    Route::post('saleAdd', 'sale/SaleAdd');
    Route::post('getPutSale/:id', 'sale/getPutSale');
    Route::get('saleDetail/:id', 'sale/SaleDetail')->model('\app\api\model\SaleModel', false);
    Route::get('saleMessage', 'sale/messageList');
    Route::post('saleMessage', 'sale/messageAdd');
    Route::post('getMessage', 'sale/getMessage');
    Route::delete('saleMessageDel/:id', 'sale/messageDel')->model('\app\api\model\SaleModel', false);
    Route::delete('saleDel/:id', 'sale/SaleDel')->model('\app\api\model\SaleModel', false);
    Route::get('saleRevoke/:id', 'sale/SaleRevoke')->model('\app\api\model\SaleModel', false);
    Route::post('saleDepot/:id', 'sale/SaleDepot')->model('\app\api\model\SaleModel', false);
    Route::get('saleAllDepot/:id', 'sale/SaleAllDepot')->model('\app\api\model\SaleModel', false);
    Route::post('getDraft/:id', 'sale/getDraft')->model('\app\api\model\SaleModel', false);
    Route::get('saleReturnList', 'sale/returnList');
    Route::post('saleReturnAdd', 'sale/returnAdd');
    Route::post('returnDraft/:id', 'sale/returnDraft')->model('\app\api\model\SaleModel', false);
    Route::get('saleReturnDetail/:id', 'sale/returnDetail')->model('\app\api\model\SaleModel', false);
    Route::post('saleReturnDepot/:id', 'sale/returnDepot')->model('\app\api\model\SaleModel', false);
    Route::get('saleReturnRevoke/:id', 'sale/returnRevoke')->model('\app\api\model\SaleModel', false);
    Route::delete('saleReturnDel/:id', 'sale/returnDel')->model('\app\api\model\SaleModel', false);
    Route::get('collectList', 'sale/collectList');
    Route::post('collectAdd', 'sale/collectAdd');
    Route::get('collectDetail/:id', 'sale/collectDetail')->model('\app\api\model\SaleModel', false);
    Route::get('collectRevoke/:id', 'sale/collectRevoke')->model('\app\api\model\SaleModel', false);
    //供应商
    Route::get('supplierList', 'supplier/index');
    Route::post('supplierAdd', 'supplier/add');
    Route::get('getAll', 'supplier/getAll');
    Route::get('supplierInfo/:id', 'supplier/show')->model('\app\api\model\SupplierModel', false);
    Route::put('supplierEdit/:id', 'supplier/edit')->model('\app\api\model\SupplierModel', false);
    Route::delete('supplierDel/:id', 'supplier/del')->model('\app\api\model\SupplierModel', false);
    //商品规格
    Route::group('', function () {
        Route::get('ColorList', 'Color/list');
        Route::post('ColorAdd', 'Color/add');
        Route::get('ColorInfo/:id', 'Color/info');
        Route::post('ColorEdit/:id', 'Color/edit');
        Route::delete('ColorDel/:id', 'Color/del');
        Route::get('ColorGroupList', 'Color/groupList');
        Route::post('ColorAddGroup', 'Color/addGroup');
        Route::get('GroupInfo/:id', 'Color/getGroup');
        Route::put('ColorEditGroup/:id', 'Color/editGroup');
        Route::delete('ColorDelGroup/:id', 'Color/delGroup');
        Route::get('getGroupSpec/:level', 'Color/getGroupSpec');

        Route::get('SizeList', 'Size/list');
        Route::post('SizeAdd', 'Size/add');
        Route::get('SizeInfo/:id', 'Size/info');
        Route::post('SizeEdit/:id', 'Size/edit');
        Route::delete('SizeDel/:id', 'Size/del');
        Route::get('SizeGroupList', 'Size/groupList');
        Route::post('SizeAddGroup', 'Size/addGroup');
        Route::get('SizeGroupInfo/:id', 'Size/getGroup');
        Route::put('SizeEditGroup/:id', 'Size/editGroup');
        Route::delete('SizeDelGroup/:id', 'Size/delGroup');

        Route::get('StyleGroupList', 'Style/groupList');
        Route::post('StyleAddGroup', 'Style/addGroup');
        Route::get('StyleGroupInfo/:id', 'Style/getGroup');
        Route::put('StyleEditGroup/:id', 'Style/editGroup');
        Route::delete('StyleDelGroup/:id', 'Style/delGroup');
        Route::get('StyleList', 'Style/list');
        Route::post('StyleAdd', 'Style/add');
        Route::get('StyleInfo/:id', 'Style/info');
        Route::put('StyleEdit/:id', 'Style/edit');
        Route::delete('StyleDel/:id', 'Style/del');

        Route::get('MaterialList', 'Material/list');
        Route::post('MaterialAdd', 'Material/add');
        Route::get('MaterialInfo/:id', 'Material/info');
        Route::put('MaterialEdit/:id', 'Material/edit');
        Route::delete('MaterialDel/:id', 'Material/del');

        Route::get('SeasonList', 'Season/list');
        Route::post('SeasonAdd', 'Season/add');
        Route::get('SeasonInfo/:id', 'Season/info');
        Route::put('SeasonEdit/:id', 'Season/edit');
        Route::delete('SeasonDel/:id', 'Season/del');

        Route::get('BrandList', 'Brand/list');
        Route::get('getAllBrand', 'Brand/getAllBrand');
        Route::post('BrandAdd', 'Brand/add');
        Route::get('BrandInfo/:id', 'Brand/info');
        Route::put('BrandEdit/:id', 'Brand/edit');
        Route::delete('BrandDel/:id', 'Brand/del');

        Route::get('UnitList', 'Unit/list');
        Route::post('UnitAdd', 'Unit/add');
        Route::get('UnitInfo/:id', 'Unit/info');
        Route::put('UnitEdit/:id', 'Unit/edit');
        Route::delete('UnitDel/:id', 'Unit/del');

        Route::get('CategoryList', 'Category/list');
        Route::get('Cate', 'Category/info');
        Route::get('getAllCategory', 'Category/getAllCategory');
        Route::post('categoryAdd', 'Category/add');
        Route::get('CateInfo/:id', 'speci/CateInfo');
        Route::put('categoryEdit/:id', 'Category/Edit');
        Route::delete('CategoryDel/:id', 'Category/Del');
    });
    //配货
    Route::get('PrepareList', 'prepare/PrepareList');
    Route::post('PrepareAdd', 'prepare/PrepareAdd');
    Route::post('getPutPrepare/:id', 'prepare/getPutPrepare');
    Route::get('PrepareDetail/:id', 'prepare/PrepareDetail')->model('\app\api\model\PrepareModel', false);
    Route::get('PrepareRevoke/:id', 'prepare/PrepareRevoke')->model('\app\api\model\PrepareModel', false);
    Route::delete('PrepareDel/:id', 'prepare/PrepareDel')->model('\app\api\model\PrepareModel', false);
    Route::post('PrepareMessage', 'prepare/message')->model('\app\api\model\PrepareModel', false);
    Route::delete('PrepareMessageDel/:id', 'prepare/delMessage')->model('\app\api\model\PrepareModel', false);
    Route::post('PrepareDepot/:id', 'prepare/depot')->model('\app\api\model\PrepareModel', false);
    Route::get('PrepareAllDepot/:id', 'prepare/alldepot')->model('\app\api\model\PrepareModel', false);
    Route::post('PrepareDraft/:id', 'prepare/PrepareDraft')->model('\app\api\model\PrepareModel', false);
    Route::post('PrepareReturnDraft/:id', 'prepare/returnDraft')->model('\app\api\model\PrepareModel', false);
    Route::get('PrepareReturnList', 'prepare/returnList');
    Route::post('PrepareReturnAdd', 'prepare/returnAdd');
    Route::post('prepareReturn/:id', 'prepare/prepareReturn');
    Route::get('PrepareReturnDetail/:id', 'prepare/returnDetail')->model('\app\api\model\PrepareModel', false);
    Route::post('PrepareReturnDepot/:id', 'prepare/returnDepot')->model('\app\api\model\PrepareModel', false);
    Route::get('PrepareReturnRevoke/:id', 'prepare/returnRevoke')->model('\app\api\model\PrepareModel', false);
    Route::delete('PrepareReturnDel/:id', 'prepare/returnDel')->model('\app\api\model\PrepareModel', false);

    Route::get('warehouse', 'warehouse/index');
    Route::post('warehouse', 'warehouse/add');
    Route::get('warehouse/:id', 'warehouse/show');
    Route::put('warehouse/:id', 'warehouse/edit');
    Route::delete('warehouse/:id', 'warehouse/del');
    // 仓库门店
    // 只允许index read edit update 四个操作
    Route::resource('warehouseStore', 'WarehouseStore')->only(['index', 'read', 'save', 'update', 'delete']);
    Route::get('warehouseStore/:id/warehouse', 'WarehouseStore/indexWarehouse');
    Route::get('getAllWarehouse', 'Warehouse/getAllWarehouse');
    Route::post('storeAdd', 'Store/store');
    Route::get('storeList', 'Store/index');
    Route::get('getStoreInfo/:id', 'Store/getStoreInfo');
    Route::post('storeEdit/:id', 'Store/update');
    Route::delete('storeDel/:id', 'Store/delete');
    Route::get('getAllStore', 'Store/getAllStore');
    Route::get('getAllKeeper', 'Store/getAllKeeper');
    //留言
    Route::post('messageAdd', 'api/Sale/messageAdd');
    Route::get('messageList', 'api/Sale/messageList');
    Route::delete('messageDel/:id', 'api/Sale/messageDel');
    Route::get('getMessage', 'api/Sale/getMessage');
    //出库单
    Route::get('warehouse/turnoverList', 'WarehouseTurnover/index');
    Route::get('warehouse/StockList', 'WarehouseTurnover/StockList');
    Route::get('warehouse/goodsList', 'WarehouseTurnover/indexGoods');
    Route::get('OutStockList', 'OutStock/index');
    Route::get('OutStockDetail/:id', 'OutStock/detail');
    Route::post('OutStockDepot/:id', 'OutStock/depot');
    Route::get('OutStockRevoke/:id', 'OutStock/revoke');
    //入库单
    Route::get('StorageList', 'Storage/index');
    Route::get('StorageDetail/:id', 'Storage/detail');
    Route::post('StorageDepot/:id', 'Storage/depot');
    Route::get('StorageRevoke/:id', 'Storage/revoke');
    //生产入库单
    Route::get('ProductionList', 'warehouse/ProductionList');
    Route::post('productionAdd', 'warehouse/productionAdd');
    Route::post('productionDraft/:id', 'warehouse/productionDraft');
    Route::post('getPutProduct/:id', 'warehouse/getPutProduct');
    Route::get('productionDetail/:id', 'warehouse/productionDetail')->model('\app\api\model\WarehouseModel', false);
    Route::get('productionRevoke/:id', 'warehouse/productionRevoke')->model('\app\api\model\WarehouseModel', false);
    Route::get('productionDetail/:id', 'warehouse/productionDetail')->model('\app\api\model\WarehouseModel', false);
    Route::get('productionDepot/:id', 'warehouse/productionDepot')->model('\app\api\model\WarehouseModel', false);
    Route::get('productionDel/:id', 'warehouse/productionDel');
    //调拨单
    Route::get('AllotList', 'warehouse/AllotList');
    Route::post('AllotAdd', 'warehouse/AllotAdd');
    Route::get('AllotDetail/:id', 'warehouse/AllotDetail');
    Route::post('Allot/:id', 'warehouse/allot');
    Route::get('AllotRevoke/:id', 'warehouse/AllotRevoke');
    Route::delete('AllotDel/:id', 'warehouse/AllotDel');
    Route::post('AllotDraft/:id', 'warehouse/AllotDraft');
    //盘点单
    Route::get('InventoryList', 'warehouse/InventoryList');
    Route::get('InventoryDetailed', 'warehouse/InventoryDetailed');
    Route::post('InventoryAdd', 'warehouse/InventoryAdd');
    Route::post('getInventoryDraft/:id', 'warehouse/getInventoryDraft');
    Route::post('getInventory/:id', 'warehouse/getInventory');
    Route::get('InventoryDetail/:id', 'warehouse/InventoryDetail');
    Route::delete('InventoryDel/:id', 'warehouse/InventoryDel');
    Route::get('InventoryRevoke/:id', 'warehouse/InventoryRevoke');
    //统计 报表
    Route::get('Purchase', 'Statistics/Purchase');
    Route::get('PurchaseSingle', 'Statistics/PurchaseSingle');
    Route::get('PurchaseBill', 'Statistics/PurchaseBill');
    Route::get('PurchaseGoods', 'Statistics/PurchaseGoods');
    Route::get('PurchaseSupplier', 'Statistics/PurchaseSupplier');
    Route::get('PurchaseMaker', 'Statistics/PurchaseMaker');
    Route::get('Sale', 'Statistics/Sale');
    Route::get('SaleSingle', 'Statistics/SaleSingle');
    Route::get('SaleGoods', 'Statistics/SaleGoods');
    Route::get('SaleBill', 'Statistics/SaleBill');
    Route::get('SaleCustom', 'Statistics/SaleCustom');
    Route::get('SalePerson', 'Statistics/SalePerson');
    Route::get('SaleStore', 'Statistics/SaleStore');
    Route::get('WareStore', 'Statistics/WareStore');
    Route::get('Inventory', 'Statistics/Inventory');
    Route::get('InventoryBill', 'Statistics/InventoryBill');
    Route::get('InventoryGoods', 'Statistics/InventoryGoods');
    Route::get('InventoryWare', 'Statistics/InventoryWare');
    Route::get('Allot', 'Statistics/Allot');
    Route::get('AllotBill', 'Statistics/AllotBill');
    Route::get('AllotGoods', 'Statistics/AllotGoods');
    Route::get('AllotWare', 'Statistics/AllotWare');
    Route::get('Production', 'Statistics/Production');
    Route::get('ProductionBill', 'Statistics/ProductionBill');
    Route::get('ProductionGoods', 'Statistics/ProductionGoods');
    Route::get('ProductionWare', 'Statistics/ProductionWare');
    Route::get('Prepare', 'Statistics/Prepare');
    Route::get('PrepareSingle', 'Statistics/PrepareSingle');
    Route::get('PrepareGoods', 'Statistics/PrepareGoods');
    Route::get('PrepareBill', 'Statistics/PrepareBill');
    Route::get('PrepareStore', 'Statistics/PrepareStore');
    Route::get('PrepareKeeper', 'Statistics/PrepareKeeper');
    Route::get('PrepareWareStore', 'Statistics/PrepareWareStore');
    Route::get('OutStock', 'Statistics/OutStock');
    Route::get('OutStockSingle', 'Statistics/OutStockSingle');
    Route::get('OutStockGoods', 'Statistics/OutStockGoods');
    Route::get('OutStockCustom', 'Statistics/OutStockCustom');
    Route::get('InStock', 'Statistics/InStock');
    Route::get('InStockSingle', 'Statistics/InStockSingle');
    Route::get('InStockGoods', 'Statistics/InStockGoods');
    Route::get('InStockSupplier', 'Statistics/InStockSupplier');
    Route::get('Analys', 'Statistics/Analys');
    Route::get('Contrast', 'Statistics/Contrast');
    Route::get('Revenue', 'Statistics/Revenue');
    //财务
    Route::post('setAccountFlow', 'SetAccountFlow/store');
    Route::get('setAccountFlow', 'SetAccountFlow/index');
    Route::get('setAccountFlow/setAccount', 'SetAccountFlow/indexSetAccount');
    Route::get('setAccountFlow/:id', 'SetAccountFlow/show');
    Route::get('collectionFlow', 'SetAccountFlow/collectionFlow');
    Route::get('FinanceList', 'Finance/FinanceList');
    Route::get('customerReconciliation', 'CustomerReconciliation/index');
    Route::get('customerReconciliation/quickHistory', 'CustomerReconciliation/quickHistory');
    Route::post('customerReconciliation', 'CustomerReconciliation/store');
    Route::post('customerReconciliation/adjustment', 'CustomerReconciliation/adjustment');
    Route::post('customerReconciliation/quick', 'CustomerReconciliation/quick');
    Route::post('supplierReconciliation', 'SupplierReconciliation/store');
    Route::post('supplierReconciliation/adjustment', 'SupplierReconciliation/adjustment');
    Route::get('supplier', 'SupplierReconciliation/index');
    Route::get('getAllAcount', 'Finance/getAllAcount');
    Route::get('getSetAcount', 'Finance/getSetAcount');
    Route::get('setAccountList', 'Finance/setAccountList');
    Route::post('setAccountAdd', 'Finance/setAccountAdd');
    Route::put('setAccountEdit/:id', 'Finance/setAccountEdit')->model('\app\api\model\FinanceModel', false);
    Route::delete('setAccountDel/:id', 'Finance/setAccountDel')->model('\app\api\model\FinanceModel', false);
    Route::get('setAccountInfo/:id', 'Finance/setAccountInfo')->model('\app\api\model\FinanceModel', false);
    Route::get('AccountType', 'Finance/AccountType');
    Route::post('AccountTypeAdd', 'Finance/AccountTypeAdd');
    Route::put('AccountTypeEdit/:id', 'Finance/AccountTypeEdit')->model('\app\api\model\FinanceModel', false);
    Route::delete('AccountTypeDel/:id', 'Finance/AccountTypeDel')->model('\app\api\model\FinanceModel', false);
    Route::get('AccountTypeInfo/:id', 'Finance/AccountTypeInfo')->model('\app\api\model\FinanceModel', false);
    // 系统日志
    Route::get('systemLogs', 'SystemLog/index');
    // 公司公告
    Route::get('announcements', 'Announcement/index');
    Route::post('announcements', 'Announcement/store');
    Route::get('announcements/:id', 'Announcement/show');
    Route::put('announcements/:id', 'Announcement/update');
    Route::delete('announcements/:id', 'Announcement/delete');
    //配置
    Route::group('', function () {
        // 物流信息
        $controller = 'Logistics';
        $prefix = 'logistics';
        Route::get($prefix, $controller . '/index');
        Route::post($prefix, $controller . '/store');
        Route::get($prefix . '/:id', $controller . '/show');
        Route::put($prefix . '/:id', $controller . '/update');
        Route::delete($prefix . '/:id', $controller . '/delete');
    });
    Route::get('config', 'config/show');
    Route::put('config', 'config/update');
    Route::group('', function () {
        // 物流网点信息
        $controller = 'LogisticsOutlets';
        $prefix = 'logisticsOutlets';
        Route::get($prefix, $controller . '/index');
        Route::post($prefix, $controller . '/store');
        Route::get($prefix . '/:id', $controller . '/show');
        Route::put($prefix . '/:id', $controller . '/update');
        Route::delete($prefix . '/:id', $controller . '/delete');
    });
    Route::group('', function () {
        // 物流网点信息
        $controller = 'Sender';
        $prefix = 'sender';
        Route::get($prefix, $controller . '/index');
        Route::post($prefix, $controller . '/store');
        Route::get($prefix . '/:id', $controller . '/show');
        Route::put($prefix . '/:id', $controller . '/update');
        Route::delete($prefix . '/:id', $controller . '/delete');
    });
    Route::get('Information', 'Dispose/Information');
    Route::put('InformationEdit/:id', 'Dispose/InformationEdit')->model('\app\api\model\DisposeModel', false);
    Route::get('Staff', 'Dispose/Staff');
    Route::post('StaffAdd', 'Dispose/StaffAdd');
    Route::put('StaffEdit/:id', 'Dispose/StaffEdit')->model('\app\api\model\DisposeModel', false);
    Route::delete('StaffDel/:id', 'Dispose/StaffDel')->model('\app\api\model\DisposeModel', false);
    Route::get('StaffInfo/:id', 'Dispose/StaffInfo')->model('\app\api\model\DisposeModel', false);
    Route::get('Banner', 'Dispose/Banner');
    Route::post('BannerAdd', 'Dispose/BannerAdd');
    Route::put('BannerEdit/:id', 'Dispose/BannerEdit')->model('\app\api\model\DisposeModel', false);
    Route::delete('BannerDel/:id', 'Dispose/BannerDel')->model('\app\api\model\DisposeModel', false);
    Route::get('BannerInfo/:id', 'Dispose/BannerInfo')->model('\app\api\model\DisposeModel', false);
    //营销
    Route::get('integral', 'Marke/integral');//积分规则列表
    Route::post('integralAdd', 'Marke/integralAdd');//新增积分规则
    Route::get('integralShop', 'Marke/integralShop');//查找商品---积分
    Route::post('integralEdit/:id', 'Marke/integralEdit')->model('\app\api\model\MarkeModel', false);//编辑积分规则
    Route::get('integralInfo/:id', 'Marke/integralInfo')->model('\app\api\model\MarkeModel', false);//积分规则详情
    Route::delete('integralDel/:id', 'Marke/integralDel')->model('\app\api\model\MarkeModel', false);//删除积分规则
    Route::get('memberCardInfo', 'Marke/memberCardInfo');//会员卡详情
    Route::post('memberCard', 'Marke/memberCard');//编辑会员卡信息
    Route::get('discount', 'Marke/discount');//折扣列表
    Route::post('discountAdd', 'Marke/discountAdd');//添加折扣
    Route::post('discountEdit/:id', 'Marke/discountEdit')->model('\app\api\model\MarkeModel', false);//编辑折扣
    Route::get('discountInfo/:id', 'Marke/discountInfo')->model('\app\api\model\MarkeModel', false);//折扣详情
    Route::delete('discountDel/:id', 'Marke/discountDel')->model('\app\api\model\MarkeModel', false);//删除折扣
    Route::get('discountShop', 'Marke/discountShop');//查找商品---折扣
    Route::get('discountRevoke/:id', 'Marke/discountRevoke')->model('\app\api\model\MarkeModel', false);//撒消折扣
    Route::get('Coupon', 'Marke/Coupon');//优惠券列表
    Route::post('CouponAdd', 'Marke/CouponAdd');//优惠券---新增
    Route::post('CouponEdit/:id', 'Marke/CouponEdit')->model('\app\api\model\MarkeModel', false);//优惠券---编辑
    Route::get('CouponInfo/:id', 'Marke/CouponInfo')->model('\app\api\model\MarkeModel', false);//优惠券---详情
    Route::delete('CouponDel/:id', 'Marke/CouponDel')->model('\app\api\model\MarkeModel', false);//优惠券---删除
    Route::get('seckill', 'Marke/seckill');//秒杀列表
    Route::post('seckillAdd', 'Marke/seckillAdd');//秒杀---新增
    Route::get('seckillOnline/:id', 'Marke/seckillOnline');//秒杀---上线
    Route::post('seckillEdit/:id', 'Marke/seckillEdit')->model('\app\api\model\MarkeModel', false);//秒杀---编辑
    Route::delete('seckillDel/:id', 'Marke/seckillDel')->model('\app\api\model\MarkeModel', false);//秒杀---删除
    Route::get('seckillInfo/:id', 'Marke/seckillInfo')->model('\app\api\model\MarkeModel', false);//秒杀---详情
    Route::get('seckillStop/:id', 'Marke/seckillStop')->model('\app\api\model\MarkeModel', false);//秒杀---停止
    Route::post('retailEdit', 'Marke/retailEdit');//编辑分销规则
    Route::get('retailInfo', 'Marke/retailInfo');//分销规则
    Route::get('retailGoods', 'Marke/retailGoods');//查找商品---分销
    Route::get('retailCustomer', 'Marke/retailCustomer');//客户
    Route::post('retailList', 'Marke/retailList');//分销列表
    Route::get('retailTotal', 'Marke/retailTotal');//分销统计
    Route::post('commodityList', 'Marke/getCommodityList');//秒杀---商品
    Route::get('productList', 'Marke/getProductList');//秒杀---商品下单品
    //商城
    Route::get('upperList', 'Shop/upperListNew');//上架商品列表
    Route::get('goodsTag', 'Shop/getGoodsTags');//标签
    Route::post('upperGoods', 'Shop/upperGoods');//上架
    Route::post('downGoods', 'Shop/downGoods');//下架
    Route::get('orderList', 'Shop/orderList');//商城-订单列表
    Route::get('clientList', 'Shop/searchUserList');//客户查询
    Route::get('orderInfo/:id', 'Shop/orderInfo')->model('\app\api\model\ShopModel', false);//订单详情
    Route::get('orderRevoke/:id', 'Shop/orderRevoke')->model('\app\api\model\ShopModel', false);//订单撒销
    Route::get('OrderTurn/:id', 'Shop/OrderTurn')->model('\app\api\model\ShopModel', false);//转销售单
    Route::post('OrderRevision', 'Shop/OrderRevision');//改价
    Route::get('memberList', 'Shop/memberList');//会员列表
    Route::get('memberInfo/:id', 'Shop/memberInfo')->model('\app\api\model\ShopModel', false);//会员信息
    Route::post('memberRelation', 'Shop/memberRelation')->model('\app\api\model\ShopModel', false);//关联客户
    Route::post('memberMove', 'Shop/memberMove');//解除关联
    Route::get('storeStateInfo', 'Shop/storeStateInfo');//店铺信息
    Route::post('storeStateEdit', 'Shop/storeStateEdit');//编辑店铺信息
    Route::get('shopBannerList', 'Shop/bannerList');//banner图列表
    Route::post('shopBannerAdd', 'Shop/AddShopBanner');//添加banner图
    Route::post('shopBannerSort', 'Shop/shopBannerSort');//排序banner图
    Route::post('shopBannerEdit', 'Shop/EditShopBanner');//编辑banner图
    Route::post('shopBannerDel', 'Shop/DelShopBanner');//删除banner图
    Route::post('getOnshopList', 'Shop/getShopList');//查找上架商品
    Route::post('getAreaList', 'Shop/getAreaList');//省，市
    Route::post('addFreight', 'Shop/addFreight');//新增运费模板
    Route::post('editFreight', 'Shop/editFreight');//编辑运费模板
    Route::post('delFreight', 'Shop/delFreight');//删除运费模板
    Route::get('getFreightList', 'Shop/getFreightList');//获取运费模板
    Route::post('setDefaultFreight', 'Shop/setDefaultFreight');//设置默认运费模板
    Route::get('getFreightOne/:id', 'Shop/getFreightOne')->model('\app\api\model\ShopModel', false);//获取运费模板详情
    Route::post('batchShopFreight', 'Shop/batchShopFreight');//批量设置运费模板
    Route::post('batchShopTag', 'Shop/batchShopTag');//批量设置商品标签
    Route::post('salePriceShow', 'Shop/salePriceShow');//销量价格展示
    Route::post('repertoryConfig', 'Shop/repertoryConfig');//库存设置
    Route::get('getShopRule', 'Shop/getShopRule');//上架商品规则
    Route::post('printNote', 'Shop/printNote');//打印
    
    /************   APP接口 start    ****************/
    Route::post('app/orderList', 'Shop/appOrderList');//商城订单列表
    Route::post('app/collectCard', 'Shop/collectMemberCard');//领取会员卡
    Route::post('app/couponList', 'Shop/appGetedCouponList');//已领取优惠券列表
    Route::post('app/couponUngetList', 'Shop/appUngetCouponList');//未领取优惠券列表
    Route::post('app/collectCoupon', 'Shop/collectCoupon');//领取优惠券
    Route::post('app/appIntegral', 'Shop/appIntegral');//积分
    Route::post('app/integralList', 'Shop/appIntegralList');//积分列表
    Route::post('app/integralDetailList', 'Shop/integralDetailList');//积分明细列表
    
    /************   APP接口 end    ****************/
    
})->allowCrossDomain()->prefix('api/');
